{template header}
<div class="container">


<div class="panel panel-default">
  <div class="panel-body">
  
  
<div class="jumbotron">

  <h1>问答 <small>读懂生活的每个细节 </small></h1>
  <p class="tar"><a href="{tsUrl('ask', 'new')}" class="btn btn-primary" role="button">我要提问</a></p>

</div>
  

	<div class="row" id="wrap">
        <div class="col-md-8">
            <div class="category">
                <ul>
                    <li>
                    <a {if $ac == 'index'}class="current"{/if} href="{tsUrl('ask')}">{if $ac == 'index'}<span>我关注的动态</span>{else}我关注的动态{/if}</a>
                    </li>
                    <li id="latest">
                    <a {if $ac == 'latest'}class="current"{/if} href="{tsUrl('ask', 'latest')}">{if $ac == 'latest'}<span>待回答的问题</span>{else}待回答的问题{/if}</a>
                    </li>
					
					
                    <li>
                    <a {if $ac == 'hot'}class="hot"{/if} href="{tsUrl('ask', 'hot')}">{if $ac == 'hot'}<span>热门问题</span>{else}热门问题{/if}</a>
                    </li>


					<li>
                    <a  {if $ac == 'my'}class="hot"{/if} href="{tsUrl('ask', 'my')}">{if $ac == 'my'}<span>我参与过的问题</span>{else}我参与过的问题{/if}</a>
                    </li>
					
					
                </ul>
            </div>
            <div class="main-title-line"></div>
            {loop $askarr $v}   
            <div class="ask">
                <div class="ask-hd">
                    <h2><a href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}" >{$v['title']}</a></h2>
                    <p class="ask-hd-r">答案&nbsp;{$v['count']}</p>
                </div>
                {if $v['cate']}
                <p class="ask-tags">
                                                  来自分类:
                    {loop $v['cate'] $k $c}
                    <a href="{tsUrl('ask', 'category', array('cateid'=>{$c['cateid']}))}">{$c['catename']}</a>{if ((count($v['cate']) - 1) > $k)}、{/if}
                    {/loop}
                </p>
                {/if}
                {if '' == $v['actionarr']['action']}
                    <div class="ask-bd">
                        <div class="pack">
                            <p class="ask-bd-act">{$v['actionarr']['addtime']}&nbsp;&nbsp;<a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['user']['userid']}))}" >{$v['actionarr']['user']['username']}</a>&nbsp;&nbsp;提问：</p>
                            <p class="ask-bd-txt">
							{$v['content']}<a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}">查看全部</a></p>
                        </div>
                    </div>
                {/if}
                
                {if 'ask_comment_op' == $v['actionarr']['action']}
                <div class="ask-bd">
                    <p class="ask-bd-up">{$v['actionarr']['addtime']}<a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['user']['userid']}))}" >{$v['actionarr']['user']['username']}</a>顶了这个答案：</p>
                    <a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}" class="ask-bd-num">{$v['actionarr']['digg']}</a>
                    <div class="pack">
                        <p class="ask-bd-act"><a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['cuser']['userid']}))}">{$v['actionarr']['cuser']['username']}</a>&nbsp;&nbsp;{$v['actionarr']['commenttime']}</p>
                        <p class="ask-bd-txt">{$v['actionarr']['comment']}<a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}#answer{$v['actionarr']['commentid']}">查看全部</a></p>
                    </div>
                </div>
                {/if}
                
                {if 'ask_comment' == $v['actionarr']['action']}
                <div class="ask-bd">
                     <div class="pack">
                         <p class="ask-bd-act">{$v['actionarr']['addtime']}&nbsp;&nbsp;<a href="{tsUrl('user','topic',array('id'=>{$v['actionarr']['user']['userid']}))}" >{$v['actionarr']['user']['username']}</a>&nbsp;&nbsp;添加了一个答案：</p>
                         <p class="ask-bd-txt">{$v['actionarr']['comment']}<a  href="{tsUrl('ask', 'question', array('id'=>{$v['askid']}))}#answer{$v['actionarr']['commentid']}">查看全部</a></p>
                     </div>
                 </div>
                 {/if}
            </div>
            {/loop}

            <div class="pages mt20">
                {if 0 != $pre}
                <a class="pages-b bw_btn" href="{$url}{$pre}"><span>&lt;</span>上一页</a>
                {/if}
                {if 0 != $next}
                <a class="pages-n bw_btn" href="{$url}{$next}">下一页<span>&gt;</span></a>
                {/if}
            </div>
        </div>

        <div class="col-md-4">
            <div class="side-title">
                <h2>问题分类</h2>
            </div>
            <ul class="side-tags" id="tagList">
                {loop $arrCate $v}
                <li>
                    <p class="side-tags-l"><a class="tag{if $selectedcate}{loop $selectedcate $cate}{if $cate['cateid']==$v['cateid']} selected{/if}{/loop}{/if}" href="{tsUrl('ask', 'category', array('cateid'=>{$v['cateid']}))}">{$v['catename']}<span class="followCounter">{$v['count_topic']}</span></a></p>
                    <a data-id="{$v['cateid']}" data-operation="follow" class="followBt side-tags-{if $selectedcate}{loop $selectedcate $cate}{if $cate['cateid']==$v['cateid']}un{/if}{/loop}{/if}follow" href="javascript:void 0;">{if $selectedcate}{loop $selectedcate $cate}{if $cate['cateid']==$v['cateid']}取消{/if}{/loop}{/if}关注</a>
                </li>
                {/loop}
            </ul>


            <!--广告位-->
            {php doAction('gobad','300')}

        </div>
    </div>
    </div>
    </div>
	
	<div class="bottom"></div>
</div>
{template footer}